package com.castle.fortress.admin.contract.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 审查方式枚举
 * 
 * @author
 * @since 2025-04-23
 */
@Getter
@AllArgsConstructor
public enum ReviewMethodEnum {
    
    AI("ai", "AI智能生成"),
    KNOWLEDGE("knowledge", "从知识库选择");
    
    /**
     * 编码
     */
    private final String code;
    
    /**
     * 描述
     */
    private final String desc;
    
    /**
     * 根据编码获取枚举
     * 
     * @param code 编码
     * @return 枚举实例
     */
    public static ReviewMethodEnum getByCode(String code) {
        for (ReviewMethodEnum reviewMethodEnum : ReviewMethodEnum.values()) {
            if (reviewMethodEnum.getCode().equals(code)) {
                return reviewMethodEnum;
            }
        }
        return null;
    }
} 